package mybatis.view;

import com.github.pagehelper.PageInfo;
import mybatis.controller.UserController;
import mybatis.entity.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Author：汤小洋
 * Date：2023-12-14 14:40
 * Description：<描述>
 */
public class UserView {
    public static void main(String[] args) {
        ApplicationContext ac = new ClassPathXmlApplicationContext("mybatis/spring.xml");
        UserController userController = (UserController) ac.getBean("userController");

        userController.register("eee","123");

        // User user = userController.login("aaa", "111");
        // if (user==null){
        //     System.out.println("登录失败");
        // }else{
        //     System.out.println("登录成功");
        // }

        // PageInfo<User> pageInfo = userController.findPage(1, 2);
        // System.out.println(pageInfo.getPages());
        // System.out.println(pageInfo.getTotal());
        // pageInfo.getList().forEach(System.out::println);
    }
}
